<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<script src="/wondershare/js/jquery.cvbox.min.js"></script> 
<title>WS文字广告管理</title>
 <style type="text/css">

catListTag {
	DISPLAY: none
}
.cvBoxShade {
	Z-INDEX: 2000; BACKGROUND: #ccc; LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: 0px; HEIGHT: 0px
}
.cvBoxBorder {
	BORDER-RIGHT: #000000 0px solid; PADDING-RIGHT: 8px; BORDER-TOP: #000000 0px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; Z-INDEX: 2000; PADDING-BOTTOM: 8px; BORDER-LEFT: #000000 0px solid; WIDTH: 100%; PADDING-TOP: 8px; BORDER-BOTTOM: #000000 0px solid; POSITION: absolute; BACKGROUND-COLOR: #ccc
}
.cvBoxBorder A {
	COLOR: #486aaa; TEXT-DECORATION: none
}
.cvBoxBorder A:hover {
	COLOR: #c00; TEXT-DECORATION: none
}
.cvBoxTitleBar {
	WIDTH: 100%; LINE-HEIGHT: 27px; HEIGHT: 26px; BACKGROUND-COLOR: #eeeeee
}
.cvBoxTitleBarText {
	PADDING-LEFT: 10px; FONT-WEIGHT: bold; FLOAT: left; COLOR: #333
}
.cvBoxTitleBarClose {
	PADDING-RIGHT: 10px; FLOAT: right; COLOR: #3867af; FONT-FAMILY: Verdana
}
.cvBoxBody {
	WIDTH: 100%; BACKGROUND-COLOR: #ffffff
}

</style>
<script>
function  delete_ad(id,type,act_type)
{
  var str = "";
  var falge = false;
  if(type == 'list')//代表为多选
  {
	  if(!confirm('您确定要删除选中的广告记录吗？'))
	  {
		  $('input[name="ID[]"]').each(function () {
			  $(this).attr('checked',false)
		  })
		  return false;
	  }
      $('input[name="ID[]"]').each(function () {
      if ($(this).attr('checked')) 
	  {
		falge = true;
       str += $(this).val() + ",";
	   $("#tr_"+$(this).val()).remove();
	   $('#total').html(parseInt($('#total').html())-1) ;
       }
      });
	  if(!falge)
	  {
	   alert('你没有选择任何选项！');   
	  }

  }else
  {
	str = id+','; 
	$("#tr_"+id).remove();
	$('#total').html(parseInt($('#total').html())-1) ;
  }
 if(act_type == 'ad')//代表为广告删除
  {
	
	 $.get("/wondershare/ad_text.php?action=del", {checkList: str },
     function(data){
		
    }); 
  }
   
}
</script>
</head>

<body >
<h1>
<span class="action-span">
<a href="/wondershare/ad_text.php?action=add_edit&act=add&w_type=<{$w_type}>">添加文字广告</a>
</span>
<span class="action-span1">
<{$web_info}>文字广告管理
</span>
<div style="clear:both"></div>
</h1>
<form method="POST" action="/wondershare/ad_text.php?action=index">
    <img height="22" border="0" width="26" alt="SEARCH" src="images/icon_search.gif">
	<span style="margin-left:40px; font-size:13px; ">广告名称：</span>
        <!-- 关键字 -->
     <input type="text" size="25" name="ad_name" value="<{$ad_name}>"   style="margin-left:10px; margin-right:10px;">
   <input type="hidden" name="w_type" value="<{$w_type}>" >
   <input type="submit" class="button"  name="search" value=" 搜索 " >
</form>
<table width="100%" cellspacing="1" cellpadding="2" id="list-table" class="list-div" style="margin-top:10px;">
<tbody>
  <tr>
  <th >文字广告ID</th> 
    <th>文字广告名称</th>
	<th>文字投放产品名称</th>
	<th>文字广告内容</th>
	<th>文字广告链接</th>
	<th>操作人员</th>
    <th>最后操作时间</th>
	<th>编辑</th>
  </tr>
  <{foreach from=$ad_info item=info}>
 
  <tr  id="tr_<{$info.ad_id}>">
    <td width="5%" align="center"  >
	<input value="<{$info.ad_id}>" name="ID[]" type="checkbox" > <{$info.ad_id}></td>
	<td width="30%" align="center" >
	<{$info.ad_name}>
	</td>
    <td width="20%" >
    <{$info.product_name_str}>
	</td>
	<td width="15%" align="center" >
	<{$info.ad_content}>
	</td>
	<td width="10%" align="center" > 
	<{$info.ad_url}>
	</td>
	<td width="5%" align="center" > 
	<{$info.ad_user_update}>
	</td>
	<td width="5%" align="center" > 
	<{$info.ad_update}>
	</td>
     <td width="10%" align="center">
    <a href="#" onclick="{if(confirm('确定要删除记录吗?')){delete_ad(<{$info.ad_id}>,'list_ad_id','ad');}return false;}" >删除</a> | 
	<a href="/wondershare/ad_text.php?action=add_edit&act=edit&w_type=<{$w_type}>&ad_id=<{$info.ad_id}>" > 编辑 </a>
    </td>
  </tr>
  <{/foreach}>
  <tr>
	    <{if $type == 0}> <td  align="center"><input name="checkall" value="checked" onclick="v=document.getElementsByName('ID[]');if(this.checked){for(i=0;i<v.length;i++)v[i].checked=true;}else{for(i=0;i<v.length;i++)v[i].checked=false;}" type="checkbox">全选</td> 
		<{else}><td></td><{/if}>
		<td width="17%" align="center"><{$page_url}> &nbsp; 共有 <span id="total"><{$total}> </span>条记录</td>
		<{if $type == 0}> 
		<td width="21%">&nbsp;&nbsp;<input name="sub" value="删除" type="button" onclick="delete_ad(0,'list','ad');"></td>
		<{else}><td><{if $type == 2 && $total>0}><input name="sub" value="取消选择" type="button" onclick="on_radio();"><{/if}></td><{/if}>
	</tr>
	
  
  </tbody>
</table>


</body>
</html>